import {createWebHistory, createWebHashHistory, createRouter} from "vue-router";

// import homerouter from './modules/home';
// import loginrouter from './modules/login';
import Layout from '@/layout/layouts.vue'; // 引入布局组件

const routes = [{
		path: '/',
		component: Layout,
		children: [{
			path: '',
			name: 'home',
			component: () => import('@/views/home/index.vue'),
		}],
	},
    {
        path: '/login',
        component: Layout,
        children: [{
            path: '',
            name: 'login',
            component: () => import('@/views/login/index.vue'),
        }]
    },
    {
        path: '/register',
        component: Layout,
        children: [{
            path: '',
            name: 'register',
            component: () => import('@/views/register/index.vue'),
        }]
    },
    {
        path: '/contactUs',
        component: Layout,
        children: [{
            path: '',
            name: 'contactUs',
            component: () => import('@/views/contactUs/index.vue'),
        }]
    },
    {
        path: '/goods',
        component: Layout,
        children: [{
            path: '',
            name: 'goods',
            component: () => import('@/views/goods/index.vue'),
        }]
    },
    {
        path: '/user',
        component: Layout,
        children: [{
            path: '',
            name: 'user',
            component: () => import('@/views/user/index.vue'),
        }]
    },
    {
        path: '/first',
        component: Layout,
        children: [{
            path: '',
            name: 'first',
            component: () => import('@/views/first/index.vue'),
        }]
    },
    {
        path: '/about',
        component: Layout,
        children: [{
            path: '',
            name: 'about',
            component: () => import('@/views/about/index.vue'),
        }]
    }
];

const router = createRouter({
    history: createWebHistory(),
    routes,
});

export default router;
